package cn.stylefeng.guns.sys.modular.dbcontentapproval.mapper;

import cn.stylefeng.guns.sys.modular.dbcontentapproval.entity.DbContentapproval;
import cn.stylefeng.guns.sys.modular.dbcontentapproval.entity.EtlJob;
import cn.stylefeng.guns.sys.modular.dbcontentapproval.model.DbDatabase;
import cn.stylefeng.guns.sys.modular.dbcontentapproval.model.DbTable;
import cn.stylefeng.guns.sys.modular.dbcontentapproval.model.DbTableDetail;
import cn.stylefeng.guns.sys.modular.dbcontentapproval.model.params.DbContentapprovalParam;
import cn.stylefeng.guns.sys.modular.dbcontentapproval.model.result.DbContentapprovalResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 内容审核列表  Mapper 接口
 * </p>
 *
 * @author zhaoyiheng
 * @since 2020-08-20
 */
public interface DbContentapprovalMapper extends BaseMapper<DbContentapproval> {

    /**
     * 获取列表
     *
     * @author zhaoyiheng
     * @Date 2020-08-20
     */
    List<DbContentapprovalResult> customList(@Param("paramCondition") DbContentapprovalParam paramCondition);

    /**
     * 获取map列表
     *
     * @author zhaoyiheng
     * @Date 2020-08-20
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") DbContentapprovalParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author zhaoyiheng
     * @Date 2020-08-20
     */
    Page<DbContentapprovalResult> customPageList(@Param("page") Page page, @Param("paramCondition") DbContentapprovalParam paramCondition);

    /**
     * 获取分页map列表
     *
     * @author zhaoyiheng
     * @Date 2020-08-20
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") DbContentapprovalParam paramCondition);

    void createTable(@Param("tableName") String tableName);

    /**
     * 保存到admindata中的表中
     */
    void insertDbDatabase(@Param("paramCondition") DbDatabase paramCondition);

    /**
     * 通过数据库名字返回数据库对象
     */
    List<DbDatabase> queryDbDatabase(@Param("paramCondition") DbDatabase paramCondition);


    /**
     * 新建数据库前先判断删除数据库
     * @param databaseName
     */
    void deleteDatabase(@Param("databaseName") String databaseName);


    /**
     * 保存到admindata中的db_table表中
     *
     * @param paramCondition
     */
    void insertDbTable(@Param("paramCondition") DbTable paramCondition);

    /**
     * 通过表信息查表详细信息
     *
     * @param paramCondition
     * @return
     */
    List<DbTable> queryDbTable(@Param("paramCondition") DbTable paramCondition);

    /**
     * 添加表字段详细信息
     * @param paramCondition
     */
    void insertDbTableDetail(@Param("paramCondition") DbTableDetail paramCondition);

    /**
     * 查询表字段详细信息
     * @param paramCondition
     * @return
     */
    List<DbTableDetail> queryDbTableDetail(@Param("paramCondition") DbTableDetail paramCondition);

    /**
     * etl_job表插入数据
     * @param paramCondition
     */
    void insertEtlJob(@Param("paramCondition") EtlJob paramCondition);

    /**
     * 根据不同条件查询etl_job详情
     * @param paramCondition
     * @return
     */
    List<EtlJob> searchEtlJob(@Param("paramCondition") EtlJob paramCondition);


    void createUser(@Param("user") String user, @Param("password") String password);

    void quanxian(@Param("tableName") String tableName, @Param("user") String user, @Param("password") String password);

    void quanxian1(@Param("tableName") String tableName, @Param("user") String user, @Param("password") String password);

    void shuaxin();
}
